<div id="maincontent">
    <div id="maincontent_inner">
        <div id="sidebar">
            <div class="menu single">
                <ul>
                    <li><a href="#">车辆故障信息库管理</a>
                        <ul>
                            <li><a href="<?php echo site_url("c=break_down&m=index"); ?>">车辆故障信息管理</a></li>
                            <li class="current"><a href="<?php echo site_url("c=break_down_category&m=index"); ?>">车辆故障类别管理</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
        <div id="content">
            <div class="title">编辑车辆故障类别</div>
            <div class="infoarea">
                <form action="<?php echo site_url("c=break_down_category&m=edit"); ?>" method="post" id="myform">
                    <input type="hidden" name="typeid" value="<?php echo $info['typeid']; ?>">
                    <table border="0" cellspacing="0" cellpadding="0" width="100%" class="aev">
                        <tr>
                            <th>类别名称:</th>
                            <td><input type="text" class="half" name="typename" value="<?php echo $info['typename']; ?>"/></td>
                        </tr>
                        <tr>
                            <th>上级分类:</th>
                            <td>
                                <select name="parentid">
                                    <option value="0" <?php
                                    if($info['typeid'] == 0) {
                                        echo 'selected';
                                    }
?>>-----无-----</option>
                                    <?php foreach ($types as $type): ?>
                                    <option value="<?php echo $type['typeid'] ?>" <?php
                                        if($info['parentid'] ==  $type['typeid']) {
                                            echo 'selected';
                                        }
                                        ?>><?php echo $type['typename'] ?></option>
                                    <?php endforeach ?>
                                </select>
                            </td>
                        </tr>
                    </table>
                    <div class="box nav" style="margin-top:5px;margin-bottom:0;">
                        &nbsp;<div style="float:right"><input type="submit" class="btn" value="确定"/><input type="button" class="btn" value="返回"
                        onclick="otoPage('<?php echo site_url("c=break_down_category&m=index"); ?>');" /></div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $("#myform").validate({
            rules:{
                typename:{
                    required:true
                }
            },
            messages:{
                typename:{
                    required:"类别名称不能为空"
                }
            }
        });
    });

</script>